//package com.mywiki.filter;
//
//import com.alibaba.fastjson.JSONObject;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//
//import javax.servlet.*;
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//import java.util.Enumeration;
//import java.util.Map;
//
///**
// * describe:
// *
// * @author: robin
// * @date 2024/1/20 20:47
// */
//@Component
//public class LogFilter implements Filter {
//
//    private static final Logger LOG = LoggerFactory.getLogger(LogFilter.class);
//
//    @Override
//    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//
//        HttpServletRequest request = (HttpServletRequest) servletRequest;
//        LOG.info("------------ LogFilter 开始 ---------------");
//        LOG.info("请求地址: {},{} ", request.getRequestURL().toString(), request.getMethod());
//        LOG.info("远程地址: {}", request.getRemoteAddr());
//        Map<String, String[]> parameterMap = request.getParameterMap();
//        String json = JSONObject.toJSON(parameterMap).toString();
//        LOG.info("请求参数: {}", json);
//
//        long startTime = System.currentTimeMillis();
//        filterChain.doFilter(servletRequest, servletResponse);
//        LOG.info("------------- LogFilter 结束 耗时: {} ms -----------------", System.currentTimeMillis() -  startTime);
//
//
//    }
//
//}
